﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;

namespace MobileManager.UserControl
{
    public partial class Smenu : System.Web.UI.UserControl
    {
        private MM.Model.T_Users userModel;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CurUser"] == null)
            {
                Response.Redirect("../Login.aspx");
                return;
            }
            else
            {
                userModel = (MM.Model.T_Users)Session["CurUser"];
            }
            if (!IsPostBack)
            {
                StringBuilder sbHTML = new StringBuilder(500);
                string strRequst = Request.Url.ToString().ToLower();
                sbHTML.Append("<table id=\"TBmenu\">");
                sbHTML.Append(string.Format("<tr><td><a href=\"SChanel.aspx\" class=\"{0}\" target=\"_self\">通道统计信息</a></td></tr>", GetClassName(strRequst, "SChanel")));
                //sbHTML.Append(string.Format("<tr><td><a href=\"S1Chanel.aspx\" class=\"{0}\" target=\"_self\">通道统计信息1</a></td></tr>", GetClassName(strRequst, "S1Chanel")));
                sbHTML.Append(string.Format("<tr><td><a href=\"SProChanel.aspx\" class=\"{0}\" target=\"_self\">通道开通情况</a></td></tr>", GetClassName(strRequst, "SProChanel")));

                sbHTML.Append(string.Format("<tr><td><a href=\"Ssim.aspx\" class=\"{0}\" target=\"_self\">SIM记录信息</a></td></tr>", GetClassName(strRequst, "Ssim")));
                sbHTML.Append(string.Format("<tr><td><a href=\"S2sim.aspx\" class=\"{0}\" target=\"_self\">SIM记录信息1</a></td></tr>", GetClassName(strRequst, "S2sim")));

                sbHTML.Append(string.Format("<tr><td><a href=\"Sreceive.aspx\" class=\"{0}\" target=\"_self\">通道返回信息</a></td></tr>", GetClassName(strRequst, "Sreceive")));
                sbHTML.Append(string.Format("<tr><td><a href=\"S4receive.aspx\" class=\"{0}\" target=\"_self\">通道返回信息1</a></td></tr>", GetClassName(strRequst, "S4receive")));
                sbHTML.Append(string.Format("<tr><td><a href=\"S1receive.aspx\" class=\"{0}\" target=\"_self\">通道返回信息2</a></td></tr>", GetClassName(strRequst, "S1receive")));
                sbHTML.Append(string.Format("<tr><td><a href=\"S2receive.aspx\" class=\"{0}\" target=\"_self\">通道返回信息3</a></td></tr>", GetClassName(strRequst, "S2receive")));

                sbHTML.Append(string.Format("<tr><td><a href=\"SsmsiAll.aspx\" class=\"{0}\" target=\"_self\">所有请求信息1</a></td></tr>", GetClassName(strRequst, "SsmsiAll")));
                sbHTML.Append(string.Format("<tr><td><a href=\"SsmiAllBySmi.aspx\" class=\"{0}\" target=\"_self\">所有请求信息2</a></td></tr>", GetClassName(strRequst, "SsmiAllBySmi")));
                sbHTML.Append(string.Format("<tr><td><a href=\"Ssm3iAll.aspx\" class=\"{0}\" target=\"_self\">所有请求信息3</a></td></tr>", GetClassName(strRequst, "Ssm3iAll")));
                sbHTML.Append(string.Format("<tr><td><a href=\"Ss4miAll.aspx\" class=\"{0}\" target=\"_self\">所有请求信息4</a></td></tr>", GetClassName(strRequst, "Ss4miAll")));
                sbHTML.Append(string.Format("<tr><td><a href=\"SIVRreceive.aspx\" class=\"{0}\" target=\"_self\">IVR返回信息</a></td></tr>", GetClassName(strRequst, "SIVRreceive")));
                //sbHTML.Append(string.Format("<tr><td><a href=\"ReturnResult.aspx\" class=\"{0}\" target=\"_self\">返回手机结果</a></td></tr>", GetClassName(strRequst, "ReturnResult")));
                sbHTML.Append(string.Format("<tr><td><a href=\"CutMobile.aspx\" class=\"{0}\" target=\"_self\">封杀手机号</a></td></tr>", GetClassName(strRequst, "CutMobile")));
                sbHTML.Append(string.Format("<tr><td><a href=\"CutIMSI.aspx\" class=\"{0}\" target=\"_self\">封杀IMSI</a></td></tr>", GetClassName(strRequst, "CutIMSI")));
                sbHTML.Append("</table>");
                divMenu.InnerHtml = sbHTML.ToString();
            }
        }
        private string GetClassName(string strRequst, string strPage)
        {
            if (strRequst.Contains(strPage.ToLower()))
                return "Aselected";
            else return "Anormal";
        }
    }
}